<div class="row">
<?if(isset($system_message))echo $system_message;
echo validation_errors() !==''?'<div class="error">'.validation_errors().'</div>' : NULL;
?>	
	<fieldset>
	<legend class="label">Search</legend>
		<form action="<?=site_url('librarian/media');?>" method="POST" class="admin-form">
		<div class="input-block">
			<label>Item Name:</label>
			<input type="text" name="search[book_name]">
		</div>
		<div class="input-block">
			<label>Item Author</label>
			<input type="text" name="search[book_author]">
		</div>
		<div class="input-block">
			<label>ISBN Number:</label>
			<input type="text" name="search[book_isbn]">
		</div>
		<div class="input-block">
			<label>Barcode:</label>
			<input type="text" name="search[book_barcode]">
		</div>
		<div class="input-block">
			<label>&nbsp;</label>
			
			<button class="btn btn-primary" type="submit" name="search_books" value="search Media" ><i class="fa fa-search"></i>&nbsp; Search Media</button>
			<a href="<?=current_url();?>" class="btn btn-default">Show All</a>
			
		</div>
		</form>
	</fieldset>
	
	<fieldset>
		<legend>Books</legend>
		<?if(!empty($media)):?>
			<table class="data-table">
				<thead class="tabular-head">
					<tr>
						<th>Types</th>
						<th>Cat.</th>
						<th>No Of Copies</th>
						<th>Available</th>
						<th>Author:</th>
						<th>ISBN:</th>
						<th>Barcode</th>
						<th>Item Name:</th>
						<th>Description:</th>
					</tr>
				</thead>
				<tbody class="tabular">
				<?foreach($media as $b):?>
					<tr>
						<td><?=$b->media_type;?></td>
						<td><?=$b->lbc_name;?></td>
						<td><?=$b->book_copies;?></td>
						<td><?=$b->book_available;?></td>
						<td><?=$b->book_author;?></td>
						<td><?=$b->book_isbn;?></td>
						<td><?=$b->book_barcode;?></td>
						<td><?=word_limiter($b->book_name,5);?></td>
						<td style="max-width:10%;word-wrap:break-word;"><?=word_limiter($b->book_desc,10);?></td>
						<td><a href="<?=site_url('librarian/update_book/'.$b->book_id);?>" class="btn"><i class="glyphicon glyphicon-edit"></i> Update</a></td>
					</tr>
				<?endforeach;?>
					<tr>
						<td>
							<a href="<?=site_url('librarian/add_books');?>" class="btn btn-mini">Add New Item</a>
						</td>
					</tr>
				</tbody>
			</table>
			<?=$links;?>
		<?else:?>
			<div class="alert">
				No items to show. <a href="<?=site_url('librarian/add_books');?>" class="btn btn-mini">Add Media</a>
			</div>
		<?endif;?>
	</fieldset>
</div>